package com.example.asapp.demo.curd;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

@Entity
@Data
@Table(name = "t_demo_curd")
public class CurdVO {

    @Id
    String id;

    @Column
    String name;

    @Column
    String password;

    public static void main(String[] args) {
        InputStream in=null;
        String res="";
        String line=null;
        try {
            Process process=Runtime.getRuntime().exec(new String[]{"sh","-c","ls"});
            process.waitFor();
            in=process.getInputStream();
            BufferedReader reader=new BufferedReader(new InputStreamReader(in));
            while((line=reader.readLine())!=null){
                res+=line+"\r\n";
            }
            System.out.println(res);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
